import { request, download } from '../../request'

// 获取网点
export function getLivingGateway() {
  return request({
    url: '/business/mqtt/device/getLivingGateway',
    method: 'get'
  })
}
// 获取站点信息
export function getSiteNameAndId(data) {
  return request({
    url: '/business/site/getSiteNameAndId',
    method: 'get',
    params: data
  })
}
// 添加设备
export function addDevice(data) {
  return request({
    url: '/business/mqtt/device/add',
    method: 'post',
    data
  })
}
// 修改设备
export function changeDevice(data) {
  return request({
    url: '/business/mqtt/device/modify',
    method: 'post',
    data
  })
}
// 修改网关
export function modifyGateway(data) {
  return request({
    url: '/business/mqtt/device/modifyGateway',
    method: 'post',
    data
  })
}
// 删除设备
export function deleteDevice(data) {
  return request({
    url: '/business/mqtt/device/delete',
    method: 'post',
    data
  })
}
// 修改通道编码
export function modifyVideoId(data) {
  return request({
    url: '/business/mqtt/device/modifyVideoId',
    method: 'post',
    data
  })
}
// 修改串口
export function setSerial(data) {
  return request({
    url: '/business/mqtt/serial/setSerial',
    method: 'post',
    data
  })
}
export function deviceSync(data) {
  return request({
    url: '/business/mqtt/device/deviceSync',
    method: 'post',
    data
  })
}
// 获取设备列表
export function getDeviceList(data) {
  return request({
    url: '/business/mqtt/device/getDeviceList',
    method: 'get',
    params: data
  })
}
// 获取串口列表
export function getSerials(data) {
  return request({
    url: '/business/mqtt/serial/getSerials',
    method: 'get',
    params: data
  })
}
// 导出列表
export function deviceexport(data) {
  return download({
    url: '/business/mqtt/device/export',
    params: data,
    responseType: 'blob'
  })
}
